
public class Builder<T> {

    private BuildHandler<T> head;
    private BuildHandler<T> tail;

    public Builder<T> addHandler(BuildHandler handler) {
        if (null == head) {
            head = this.tail = handler;
            return this;
        }

        this.tail.next(handler);
        this.tail = handler;
        return this;

    }

    public BuildHandler<T> build() {
        return this.head;
    }
}